{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# utility modules\n",
    "import glob\n",
    "import os\n",
    "import sys\n",
    "import re\n",
    "import io\n",
    "\n",
    "# the usual suspects\n",
    "import numpy as np\n",
    "import cartopy.crs as ccrs\n",
    "from cartopy.io import shapereader\n",
    "from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER\n",
    "import cartopy.io.img_tiles as cimgt\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.cm as cm\n",
    "# import matplotlib.image as mpimg\n",
    "\n",
    "# modules you'll need if you're downloading the data\n",
    "from icepyx import icesat2data as ipd\n",
    "import shutil\n",
    "import geopandas as gpd\n",
    "import pandas as pd\n",
    "from shapely.geometry import Point, Polygon\n",
    "\n",
    "import fiona\n",
    "import pyproj\n",
    "import h5py\n",
    "\n",
    "# # run matplotlib in 'widget' mode\n",
    "# %matplotlib widget\n",
    "# %load_ext autoreload\n",
    "# %autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from readers.read_HDF5_ATL13 import read_HDF5_ATL13\n",
    "ATL13_file = 'ATL13_20190429114134_04770301_003_01.h5'\n",
    "IS2_atl13_mds, IS2_atl13_attrs, IS2_atl13_beams = read_HDF5_ATL13(ATL13_file)\n",
    "beam = ['gt1l','gt1r','gt2l','gt2r','gt3l','gt3r']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4422.267985026042\n",
      "0.06260917535201214\n"
     ]
    }
   ],
   "source": [
    "fiona.drvsupport.supported_drivers['kml'] = 'rw' \n",
    "fiona.drvsupport.supported_drivers['KML'] = 'rw'\n",
    "lake_filepath = os.getcwd()+'/sikkimlakes.kml'\n",
    "gdfl = gpd.read_file(lake_filepath) \n",
    "mask = gdfl.geometry.unary_union\n",
    " \n",
    "D13 = {}\n",
    "stdev = []\n",
    "surface = 0\n",
    "for i in beam:\n",
    "    D13[i] = {}    \n",
    "    flag = np.zeros(IS2_atl13_mds[i]['segment_lon'].size, dtype=bool)\n",
    "    for j in range(0, IS2_atl13_mds[i]['segment_lon'].size):\n",
    "        flag[j] = (Point(IS2_atl13_mds[i]['segment_lon'][j],IS2_atl13_mds[i]['segment_lat'][j]).within(mask)) & (IS2_atl13_mds[i]['segment_lat'][j]>28.3)\n",
    "    D13[i]['lon'] = IS2_atl13_mds[i]['segment_lon'][flag]\n",
    "    D13[i]['lat'] = IS2_atl13_mds[i]['segment_lat'][flag]\n",
    "    D13[i]['h_ortho'] = IS2_atl13_mds[i]['ht_ortho'][flag]\n",
    "    D13[i]['ice_flag'] = IS2_atl13_mds[i]['ice_flag'][flag]\n",
    "    stdev = np.append(stdev, D13[i]['h_ortho'][~np.isnan(D13[i]['h_ortho'])])\n",
    "    # calculate the mean surface height of lake\n",
    "    surface = surface + np.average(D13[i]['h_ortho'][~np.isnan(D13[i]['h_ortho'])])\n",
    "surface /= len(beam)\n",
    "print(surface)\n",
    "stdev = np.std(stdev)\n",
    "print(stdev)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAD4CAYAAAAQP7oXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dfXBc9X3v8ffXkm3JMZZCbd9IyK1JMcU8lYJCzFBIagZKgmXIdZOaS0PazMQkDVMglzgxHhtsLrQ2ndqXSRqGkKaBm+DQ3FAiSEpycUhSakglP4ERDzYhIEtg0yDFxo+SvvePc1Y+Wu3Db1fa1Rp9XjM72v2dp++eXe33/B7OOebu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REQkmJKGiIgEU9IQEZFgShoiIhJMSUNERIIpaYiISLD/Dwddy31/t7OCAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "for gtx in ['gt1l','gt1r','gt2l','gt2r','gt3l','gt3r']:\n",
    "    flag = (D13[gtx]['h_ortho']>0)\n",
    "    y = plt.scatter(D13[gtx]['lat'][flag],D13[gtx]['h_ortho'])#[flag])\n",
    "plt.show()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
